package org.chinacloud.wanghui.jdownload;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * User: wanghui
 * Date: 13-10-30
 * Time: 下午2:57
 * To change this template use File | Settings | File Templates.
 */
public class ProgressRenderer extends JProgressBar
        implements TableCellRenderer {
    public ProgressRenderer(int min, int max) {
        super(min, max);
    }

    public Component getTableCellRendererComponent(
            JTable table, Object value, boolean isSelected,
            boolean hasFocus, int row, int column){

        setValue((int) ((Float) value).floatValue());
        return this;
    }
}